package com.slofzx.nuoda.evaluation.enums;

import com.slofzx.nuoda.common.enums.SysPermission;

public enum  PermissionEnum implements SysPermission {
    SYS_USER_SYNC("sys_user:sync", "用户同步", "用户同步权限"),
    SYS_OFFICE_SYNC("sys_office:sync", "组织机构同步", "组织机构同步权限"),
    SYS_USER_MANAGE_ALL("sys_user:manage_all", "全部用户管理权限", "全部用户管理权限"),
    ;
    private String desc;
    private String id;
    private String name;

    @Override
    public String getDescription() {
        return this.desc;
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public String getName() {
        return this.name;
    }

    PermissionEnum(String id, String name, String desc) {
        this.id = id;
        this.name = name;
        this.desc = desc;
    }

    public static PermissionEnum getEnum(String id) {
        for(PermissionEnum value: PermissionEnum.values()) {
            if (value.getId().equals(id)) {
                return value;
            }
        }

        return null;
    }
}
